import jwt

class JWTE:
    def __init__(self):
        self.secret_key='swdfghjk'
    # 加密
    def jia_secret(self,data):
        token=str(jwt.encode(data,self.secret_key,algorithm=['HS256']).encode('utf-8'))
        return token
    # 解密
    def jie_secret(self,token):
        payload=jwt.decode(token,self.secret_key,algorithms=['HS256'])
        return payload

jwta=JWTE()
